import ajax, { ListResult } from '../ajax';


export function getList(data:any) {
  return ajax.post<ListResult>(`/ControlPanels/Parameters/Query`, data);
}

export function updateEntity(data:any) {
  if (!data.application) {
    data.applicationId = 10;
  }
  
  if(data.parameterId) {
    return ajax.put<any>('/ControlPanels/Parameters', data);
  } else {
    return ajax.post<any>('/ControlPanels/Parameters', data);
  }
}

export function deleteEntity(id:number) {
  let deleteCommand = {"id": id};
  return ajax.put<any>('/ControlPanels/Parameters/Actions/Delete', deleteCommand);
}